package java_thinking.unit_15._15_4;

import java.util.EnumSet;
import java.util.Set;

import static java_thinking.unit_15._15_4.Watercolors.*;

/**
 * @Description :   可以返回某个范围的第一个元素与最后一个元素
 * @author: cww
 * @DateTime: 2019-04-02 22:58
 */

public class WatercolorSets {
    public static void main(String[] args) {
        Set<Watercolors> set1 = EnumSet.range(BRILLIANT_RED,VIRIDIAN_HUE);
        Set<Watercolors> set2 = EnumSet.range(CERULEAN_BLUE_HUE,BURNT_UMBER);
        System.out.println(set1);
        System.out.println(set2);
        System.out.println("union(set1,set2): "+Sets.union(set1,set2));
        System.out.println("difference(set1,set2): "+Sets.difference(set1,set2));
        System.out.println("intersection(set1,set2): "+Sets.intersection(set1,set2));
        System.out.println("complement(set1,set2): "+Sets.complement(set1,set2));
    }
}
